import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/rb-merchant/merchant/feetMerForm/feet_mer_form/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const apiFormCode = (formCode) => {
  return request({
    url: '/api/rb-merchant/merchant/feetMerForm/feet_mer_form/formQrUrl',
    method: 'get',
    params: {formCode}
  })
}

// 新增模板
export const add = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/feetMerForm/feet_mer_form/save',
    method: 'post',
    data: row
  })
}
// 获取模板组件
export const apiTemplate = (params) => {
  return request({
    url: '/api/rb-merchant/merchant/feetMerFormDefined/feet_mer_form_defined/detail',
    method: 'get',
    params
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/rb-merchant/merchant/feetMerForm/feet_mer_form/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const saveForm = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/feetMerFormDefined/feet_mer_form_defined/save',
    method: 'post',
    data:row
  })
}

// 商户端-查看开通功能
export const apiListRpi = (params) => {
  return request({
    url: '/api/rb-merchant/merchant/merchantMarket/merchant_market/listRpi',
    method: 'get',
    // headers: {'Content-Type':'application/json; charset=utf-8'},
    // params:JSON.stringify(params)
    params
  })
}

/* 删除 */
export const remove = (formCode,rpiNo) => {
  return request({
    url: '/api/rb-merchant/merchant/feetMerForm/feet_mer_form/delete',
    method: 'post',
    params: {
      formCode,
      rpiNo
    }
  })
}

/* 修改状态 */
export const editStatus = (formCode,formStatus,rpiNo) => {
  return request({
    url: '/api/rb-merchant/merchant/feetMerForm/feet_mer_form/editStatus',
    method: 'post',
    params: {
      formCode,
      formStatus,
      rpiNo
    }
  })
}

